<?php
//include_once($path['base'] . "model/database.php");
//include_once($path['base'] . "model/article.php");

class template {
    
    protected $database;
    protected $path;
    protected $string;
    protected $str_alt;
            
            
    protected $title;
    protected $author;
    protected $keywords;
    protected $description;
    protected $page;
    

    protected $therapeutics_id;
    

    public function __construct($title, $author, $keywords, $description, $page) {
        
        $this->set_language();
        
        global $string;
        $this->string = & $string;
        global $str_alt;
        $this->str_alt = & $str_alt;
        
        global $path;
        $this->path =& $path;
        

        $this->page = $page;
        $this->title = $title;
        $this->author = $author;
        $this->keywords = $keywords;
        $this->description = $description;       
        
        if ($page == "therapeutics") {
            
            if (isset($_GET['id'])) {
                $this->therapeutics_id = $_GET['id'];

            }
            else {
                $this->therapeutics_id = 0;
            }

        }
        
        
    }
    
    
    public function set_language() {
        if(isset($_GET['lang'])) {
            $_SESSION['language'] = $_GET['lang'];
        }
        else {
            if (!isset($_SESSION['language'])) {
                $_SESSION['language'] = 1;
            }
        }
    }
    
    
    public function view() {
        $this->view_up();
        include_once($this->path['base'] . "view/main_page/" . $this->page . ".php");
        $this->view_down();
    }
    
    private function view_up() {
        include_once($this->path['base'] . "view/global/head.php");
        include_once($this->path['base'] . "view/global/header.php");
        include_once($this->path['base'] . "view/global/left_module.php");
        
    }
    
    private function view_down() {
        include_once($this->path['base'] . "view/global/footer_menu.php");
        include_once($this->path['base'] . "view/global/footer.php");
        include_once($this->path['base'] . "view/global/foot.php");
    }   
    
    public function getTherapeuticsID() {
        return $this->therapeutics_id;
    }
    

}

?>